<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="resources/css/bootstrap.min.css" />
  <link rel="stylesheet" href="resources/css/bootstrap-responsive.min.css" />
  <link rel="stylesheet" href="resources/css/matrix-login.css" />
  <link href="resources/font-awesome/css/font-awesome.css" rel="stylesheet" />
  <link rel="stylesheet" href="resources/css/jquery.gritter.css" />
  <link rel="icon" href="resources/img/icon.png" sizes="512x512">
</head>
<body>
<h3>用户登录注册</h3><br>
<button id="vertifycode">手机验证码</button>
<button id="registe">用户注册</button>
<button id="login">登录</button>
<button id="weichatmsg">微信推送</button>

<br>
<h3><a href="./registe">用户注册</a></h3>
</body>
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/matrix.login.js"></script>
<script src="resources/js/jquery.gritter.min.js"></script>
<script src="resources/js/vue.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	
	$("#vertifycode").click(vertifycode);
	$("#registe").click(registe);
	$("#login").click(login);
	
	$("#weichatmsg").click(weichatmsg);

});


function vertifycode(){
	$.ajax("./sms/send/code", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"phone":"18968383532"}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}


function registe(){
	$.ajax("./common/login/registe", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"username":"anson","phone":"17855833076","password":"123456","userType":"admin"}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}

function login(){
	$.ajax("./common/login/sign/in", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"phone":"17855833076","password":"123456","remember":true}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}


function weichatmsg(){
	$.ajax("./wechat/message/course/notice", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"first":"您已成功预订以下课程，我们不见不散~","keyword1":"C++初级课程","keyword2":"06月19日（周四）16:00",
			   "keyword3":"翠柏路89号宁波工程学院西校区","remark":"您将在开课前一天再次收到提醒"}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}


</script>
</html>